<template>
  <el-pagination
    :page-size="paginations.pageSize"
    :page-sizes="[10,20]"
    :total="paginations.totalNum"
    :current-page.sync="paginations.currentPage"
    background
    layout="sizes, prev, pager, next"
    @current-change="handleCurrentChange"
    @size-change="handleSizeChange"/>
</template>
<script>
export default {
  props: {
    paginations: {
      totalNum: 0,
      currentPage: 1,
      pageSize: 10,
      type: Object,
      default: () => ({})
    }
  },
  mounted() {
    this.handleCurrentChange(this.paginations.currentPage)
  },
  methods: {
    handleSizeChange(val) {
      // console.log(val + '====')
      this.$emit('handleSizeChange', val)
    },
    handleCurrentChange(val) {
      // console.log(val)
      this.$emit('handleCurrentChange', val)
    }
  }
}
</script>
